#ifndef GEOPOSTGISLINKER_H
#define GEOPOSTGISLINKER_H

#include <QWidget>
#include "geolayer.h"
#include "gdal.h"
#include "gdal_priv.h"
#include "ogrsf_frmts.h"
#include <QSqlDatabase>
#include <QSqlQueryModel>
#include <QSqlQuery>
#include <QSqlRecord>
#include <QtSql>
#include<QStandardItemModel>
namespace Ui {
class postGISLinker;
}

class postGISLinker : public QWidget
{
    Q_OBJECT

public:
    Ui::postGISLinker *ui;

    postGISLinker(QWidget *parent = nullptr);

    ~postGISLinker();
signals:
    void drawNow(geoLayer*layer);


private slots:
    void toDraw();//按下绘制键发出信号
    void slotLink();
    void processRecord(QByteArray wkb);
    void changeDrawMap(QModelIndex index);//将绘制的地图索引

private:
    QSqlQueryModel* propertieModel = nullptr;
    QSqlQueryModel* model = nullptr;
    geoLayer* layer = nullptr;
    int mapIndexID;
    QSqlDatabase db;
    void setTablesList();
    int drawIndex;
    QStandardItemModel *ItemModel;
};

#endif // GEOPOSTGISLINKER_H



